<%@Page Language="VB" debug="true"%>
<%@Import Namespace="System.Drawing" %>
<html>
<head>

<script language="JScript">
<!--
function ShowHTMLContent() {
  var strURL = 'http://<% = Request.ServerVariables("SERVER_NAME") %><% = Request.Path %>?<% = Request.QueryString %>';
  var strDisplay = new String;
  var objHTTP = new ActiveXObject("microsoft.XMLHTTP")
  objHTTP.open('GET', strURL, false);
  objHTTP.send();
  var strReply = objHTTP.responseText;
  var intStart = strReply.indexOf('<!' + '--start-->') + 12;
  var intEnd = strReply.indexOf('<!' + '--end-->');
  if ((intStart > 0) && (intEnd > intStart))
    var strDisplay = strReply.substring(intStart, intEnd);
  document.all['outHTML'].innerText = strDisplay + ' ';
}
function SetCheck(strCheckboxName) {
  document.all[strCheckboxName].checked = true;
}
//-->
</script>

<!-- #include file="style.inc" -->
</head>
<body bgcolor="#ffffff" onload="ShowHTMLContent()">
<!--------------------------------------------------------------------------->
<span class="heading">ASP:Calendar Control</span><p />
<form runat="server" method="get">
<!--start-->
<ASP:Calendar id="MyControl" runat="server" />
<!--end-->

<p />
<div id="outError" runat="server" />
<font face="Courier New" size="2"><div style="background-color:gainsboro; padding-left:10px" id="outHTML">Fetching HTML content...</div></font>


<table border="0">
<tr><td nowrap="nowrap"><input type="checkbox" id="chkAccessKey" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">AccessKey =</td><td nowrap="nowrap"><input type="text" size="1" id="txtAccessKey" runat="server" onkeypress="SetCheck('chkAccessKey')" /></td>
<td nowrap="nowrap">&nbsp; &nbsp; &nbsp; &nbsp;</td>
<td nowrap="nowrap"><input type="checkbox" id="chkBackColor" runat="server" /> Set: &nbsp;</td><td align="right" nowrap="nowrap">BackColor =</td><td nowrap="nowrap"><input type="text" size="15" id="txtBackColor" runat="server" onkeypress="SetCheck('chkBackColor')" /></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkBorderColor" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">BorderColor =</td><td nowrap="nowrap"><input type="text" size="15" id="txtBorderColor" runat="server" onkeypress="SetCheck('chkBorderColor')" /></td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkBorderStyle" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">BorderStyle =</td><td nowrap="nowrap"><select id="selBorderStyle" size="1" runat="server" onchange="SetCheck('chkBorderStyle')">
<option value="4">BorderStyle.Solid</option><option value="3">BorderStyle.Dashed</option><option value="2">BorderStyle.Dotted</option><option value="5">BorderStyle.Double</option>
<option value="6">BorderStyle.Groove</option><option value="8">BorderStyle.Inset</option><option value="1">BorderStyle.None</option><option value="0">BorderStyle.NotSet</option>
<option value="9">BorderStyle.Outset</option><option value="7">BorderStyle.Ridge</option></select></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkBorderWidth" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">BorderWidth =</td><td nowrap="nowrap"><input type="text" size="2" id="txtBorderWidth" runat="server" onkeypress="SetCheck('chkBorderWidth')" />px</td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkCellPadding" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">CellPadding =</td><td nowrap="nowrap"><input type="text" size="2" id="txtCellPadding" runat="server" onkeypress="SetCheck('chkCellPadding')" />px</td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkCellSpacing" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">CellSpacing =</td><td nowrap="nowrap"><input type="text" size="2" id="txtCellSpacing" runat="server" onkeypress="SetCheck('chkCellSpacing')" />px</td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkDayNameFormat" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">DayNameFormat =</td><td nowrap="nowrap"><select id="selDayNameFormat" size="1" runat="server" onchange="SetCheck('chkDayNameFormat')">
<option value="2">DayNameFormat.FirstLetter</option><option value="3">DayNameFormat.FirstTwoLetters</option><option value="0">DayNameFormat.Full</option><option value="1">DayNameFormat.Short</option></select></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkEnabled" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Enabled =</td><td nowrap="nowrap"><select id="selEnabled" size="1" runat="server" onchange="SetCheck('chkEnabled')"><option>True</option><option>False</option></select></td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkFirstDayOfWeek" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">FirstDayOfWeek =</td><td nowrap="nowrap"><select id="selFirstDayOfWeek" size="1" runat="server" onchange="SetCheck('chkFirstDayOfWeek')">
<option value="7">FirstDayOfWeek.Default</option><option value="5">FirstDayOfWeek.Friday</option><option value="1">FirstDayOfWeek.Monday</option><option value="6">FirstDayOfWeek.Saturday</option>
<option value="0">FirstDayOfWeek.Sunday</option><option value="4">FirstDayOfWeek.Thursday</option><option value="2">FirstDayOfWeek.Tuesday</option><option value="3">FirstDayOfWeek.Wednesday</option></select></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkForeColor" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">ForeColor =</td><td nowrap="nowrap"><input type="text" size="15" id="txtForeColor" runat="server" onkeypress="SetCheck('chkForeColor')" /></td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkHeight" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Height =</td><td nowrap="nowrap"><input type="text" size="2" id="txtHeight" runat="server" onkeypress="SetCheck('chkHeight')" />px</td>
</tr><tr>
<td nowrap="nowrap"></td><td align="right" nowrap="nowrap">ID =</td><td nowrap="nowrap"><% = MyControl.ID %></td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkNextMonthText" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">NextMonthText =</td><td nowrap="nowrap"><input type="text" size="10" id="txtNextMonthText" runat="server" onkeypress="SetCheck('chkNextMonthText')" /></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkNextPrevFormat" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">NextPrevFormat =</td><td nowrap="nowrap"><select id="selNextPrevFormat" size="1" runat="server" onchange="SetCheck('chkNextPrevFormat')">
<option value="0">NextPrevFormat.CustomText</option><option value="2">NextPrevFormat.FullMonth</option><option value="1">NextPrevFormat.ShortMonth</option></select></td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkPrevMonthText" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">PrevMonthText =</td><td nowrap="nowrap"><input type="text" size="10" id="txtPrevMonthText" runat="server" onkeypress="SetCheck('chkPrevMonthText')" /></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkSelectedDate" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">SelectedDate =</td><td nowrap="nowrap"><input type="text" size="25" id="txtSelectedDate" runat="server" onkeypress="SetCheck('chkSelectedDate')" /></td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkSelectMonthText" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">SelectMonthText =</td><td nowrap="nowrap"><input type="text" size="10" id="txtSelectMonthText" runat="server" onkeypress="SetCheck('chkSelectMonthText')" /></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkSelectWeekText" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">SelectWeekText =</td><td nowrap="nowrap"><input type="text" size="10" id="txtSelectWeekText" runat="server" onkeypress="SetCheck('chkSelectWeekText')" /></td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkShowDayHeader" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">ShowDayHeader =</td><td nowrap="nowrap"><select id="selShowDayHeader" size="1" runat="server" onchange="SetCheck('chkShowDayHeader')"><option>True</option><option>False</option></select></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkShowGridLines" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">ShowGridLines =</td><td nowrap="nowrap"><select id="selShowGridLines" size="1" runat="server" onchange="SetCheck('chkShowGridLines')"><option>True</option><option>False</option></select></td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkShowNextPrevMonth" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">ShowNextPrevMonth =</td><td nowrap="nowrap"><select id="selShowNextPrevMonth" size="1" runat="server" onchange="SetCheck('chkShowNextPrevMonth')"><option>True</option><option>False</option></select></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkShowTitle" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">ShowTitle =</td><td nowrap="nowrap"><select id="selShowTitle" size="1" runat="server" onchange="SetCheck('chkShowTitle')"><option>True</option><option>False</option></select></td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkTitleFormat" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">TitleFormat =</td><td nowrap="nowrap"><select id="selTitleFormat" size="1" runat="server" onchange="SetCheck('chkTitleFormat')">
<option value="0">TitleFormat.Month</option><option value="1">TitleFormat.MonthYear</option></select></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkTodaysDate" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">TodaysDate =</td><td nowrap="nowrap"><input type="text" size="15" id="txtTodaysDate" runat="server" onkeypress="SetCheck('chkTodaysDate')" /></td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkToolTip" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">ToolTip =</td><td nowrap="nowrap"><input type="text" size="20" id="txtToolTip" runat="server"  onkeypress="SetCheck('chkToolTip')"/></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkVisible" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Visible =</td><td nowrap="nowrap"><select id="selVisible" size="1" runat="server" onchange="SetCheck('chkVisible')"><option>True</option><option>False</option></select></td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkVisibleDate" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">VisibleDate =</td><td nowrap="nowrap"><input type="text" size="20" id="txtVisibleDate" runat="server" onkeypress="SetCheck('chkVisibleDate')" /></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkWidth" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Width =</td><td nowrap="nowrap"><input type="text" size="2" id="txtWidth" runat="server" onkeypress="SetCheck('chkWidth')" />px</td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="button" Value="Reset" onclick="javascript:location.href='http://<% = Request.ServerVariables("SERVER_NAME") %><% = Request.Path %>'"></td><td nowrap="nowrap"></td><td nowrap="nowrap"><input type="submit" Value="Update" runat="server" /></td></tr>
</table>
</form>

<script language="VB" runat="server">
Sub Page_Load()

outError.innerHTML = ""

Try

   If IsPostBack() Then

      If chkAccessKey.Checked Then MyControl.AccessKey = txtAccessKey.Value
      If chkBackColor.Checked Then MyControl.BackColor = Color.FromName(txtBackColor.Value)
      If chkBorderColor.Checked Then MyControl.BorderColor = Color.FromName(txtBorderColor.Value)
      If chkBorderStyle.Checked Then MyControl.BorderStyle = selBorderStyle.Value
      If chkBorderWidth.Checked Then MyControl.BorderWidth = Unit.Pixel(txtBorderWidth.Value)
      If chkCellPadding.Checked Then MyControl.CellPadding = txtCellPadding.Value
      If chkCellSpacing.Checked Then MyControl.CellSpacing = txtCellSpacing.Value
      If chkDayNameFormat.Checked Then MyControl.DayNameFormat = selDayNameFormat.Value
      If chkEnabled.Checked Then MyControl.Enabled = selEnabled.Value
      If chkFirstDayOfWeek.Checked Then MyControl.FirstDayOfWeek = selFirstDayOfWeek.Value
      If chkForeColor.Checked Then MyControl.ForeColor = Color.FromName(txtForeColor.Value)
      If chkHeight.Checked Then MyControl.Height = Unit.Pixel(txtHeight.Value)
      If chkNextMonthText.Checked Then MyControl.NextMonthText = txtNextMonthText.Value
      If chkNextPrevFormat.Checked Then MyControl.NextPrevFormat = selNextPrevFormat.Value
      If chkPrevMonthText.Checked Then MyControl.PrevMonthText = txtPrevMonthText.Value
      If chkSelectedDate.Checked Then MyControl.SelectedDate = txtSelectedDate.Value
      If chkSelectMonthText.Checked Then MyControl.SelectMonthText = txtSelectMonthText.Value
      If chkSelectWeekText.Checked Then MyControl.SelectWeekText = txtSelectWeekText.Value
      If chkShowDayHeader.Checked Then MyControl.ShowDayHeader = selShowDayHeader.Value
      If chkShowGridLines.Checked Then MyControl.ShowGridLines = selShowGridLines.Value
      If chkShowNextPrevMonth.Checked Then MyControl.ShowNextPrevMonth = selShowNextPrevMonth.Value
      If chkShowTitle.Checked Then MyControl.ShowTitle = selShowTitle.Value
      If chkTitleFormat.Checked Then MyControl.TitleFormat = selTitleFormat.Value
      If chkTodaysDate.Checked Then MyControl.TodaysDate = txtTodaysDate.Value
      If chkToolTip.Checked Then MyControl.ToolTip = txtToolTip.Value
      If chkVisible.Checked Then MyControl.Visible = selVisible.Value
      If chkVisibleDate.Checked Then MyControl.VisibleDate = txtVisibleDate.Value
      If chkWidth.Checked Then MyControl.Width = Unit.Pixel(txtWidth.Value)

   End If

   txtAccessKey.Value = MyControl.AccessKey
   txtBackColor.Value = MyControl.BackColor.Name
   txtBorderColor.Value = MyControl.BorderColor.Name
   selBorderStyle.Value = MyControl.BorderStyle
   txtBorderWidth.Value = MyControl.BorderWidth.Value
   txtCellPadding.Value = MyControl.CellPadding
   txtCellSpacing.Value = MyControl.CellSpacing
   selDayNameFormat.Value = MyControl.DayNameFormat
   selEnabled.Value = MyControl.Enabled
   selFirstDayOfWeek.Value = MyControl.FirstDayOfWeek
   txtForeColor.Value = MyControl.ForeColor.Name
   txtHeight.Value = MyControl.Height.Value
   txtNextMonthText.Value = MyControl.NextMonthText
   selNextPrevFormat.Value = MyControl.NextPrevFormat
   txtPrevMonthText.Value = MyControl.PrevMonthText
   txtSelectedDate.Value = MyControl.SelectedDate
   txtSelectMonthText.Value = MyControl.SelectMonthText
   txtSelectWeekText.Value = MyControl.SelectWeekText
   selShowDayHeader.Value = MyControl.ShowDayHeader
   selShowGridLines.Value = MyControl.ShowGridLines
   selShowNextPrevMonth.Value = MyControl.ShowNextPrevMonth
   selShowTitle.Value = MyControl.ShowTitle
   selTitleFormat.Value = MyControl.TitleFormat
   txtTodaysDate.Value = MyControl.TodaysDate
   txtToolTip.Value = MyControl.ToolTip
   selVisible.Value = MyControl.Visible
   txtVisibleDate.Value = MyControl.VisibleDate
   txtWidth.Value = MyControl.Width.Value

Catch objError As Exception

   outError.innerHTML = "<b>* Error</b>: " & objError.Message & "<p />"

End Try

End Sub
</script>

<!--------------------------------------------------------------------------->
<!-- #include file="foot.inc" -->
</body>
</html>
